package com.vic.test.thread;

public class SequenceB implements Sequence {
	
	private static ThreadLocal<Integer> numberContainer = new ThreadLocal<Integer>() {
		protected Integer initialValue(){
			return 0;
		}
	};

	public int getNumber() {
		numberContainer.set(numberContainer.get() + 1);
		return numberContainer.get();
	}
	
	public static void main(String[] args) {
		Sequence s = new SequenceB();
		ClientThread c1 = new ClientThread(s);
		ClientThread c2 = new ClientThread(s);
		ClientThread c3 = new ClientThread(s);
		c1.start();
		c2.start();
		c3.start();
	}

}
